import request from '@/utils/request'

// 查询优惠劵列表
export function listCouponsDiscount(query) {
  return request({
    url: '/platuser/couponsDiscount/list',
    method: 'get',
    params: query
  })
}

// 查询优惠劵详细
export function getCouponsDiscount(id) {
  return request({
    url: '/platuser/couponsDiscount/' + id,
    method: 'get'
  })
}

// 新增优惠劵
export function addCouponsDiscount(data) {
  return request({
    url: '/platuser/couponsDiscount',
    method: 'post',
    data: data
  })
}

// 修改优惠劵
export function updateCouponsDiscount(data) {
  return request({
    url: '/platuser/couponsDiscount',
    method: 'put',
    data: data
  })
}

// 删除优惠劵
export function delCouponsDiscount(id) {
  return request({
    url: '/platuser/couponsDiscount/' + id,
    method: 'delete'
  })
}

// 优惠券领取情况汇总
export function getCouponReceivedDetail(id) {
  return request({
    url: `/platuser/couponsDiscount/detail/${id}`,
    method: 'get'
  })
}

// 优惠券领取记录
export function getCouponReceivedRecord(data) {
  return request({
    url: '/platuser/couponsDetail/list',
    method: 'get',
    params: data
  })
}
